<?php
  class Label extends Component {
    private $text;

    function show($id) {
      parent::show($id,$this->text);
      echo "function " . $this->uuid . "_setText(text) {\n";
      echo "  document.getElementById('" . $this->uuid . "').innerHTML = text;\n";
      echo "}\n";        
        
    }
    function setTextInternal($text) {
        $this->text = $text;
    }
    function setText($text) {
      global $RUNSTATE;
      $this->text = $text;
      if($RUNSTATE=="javascript") {
        echo $this->uuid . "_setText('" . $text . "');\n";
      }
    }
    function getText() {
      return $this->text;
    }
    function __construct($uuid,$text="") {
      parent::__construct($uuid);
      $this->text = $text;
      $this->setBounds(20,40,100,30);
    }
  }

?>